#include <stdio.h>
#include <string.h>

char* strrev(char*);

int main(int argc,const char** argv)
{
  char buf[] = "123456";
  strrev(buf);
  printf("%s\n",buf);

  return 0;
}

char* strrev(char* str)
{
  int i = 0;
  int j = strlen(str) - 1;
  char tmp;

  while(i <= j)
  {
    tmp = str[i];
    str[i] = str[j];
    str[j] = tmp;
    i++;
    j--;
  }

  return str;
}
